# 设置CMake最低版本为3.10
cmake_minimum_required(VERSION 3.10)

# 设置项目的版本为1.0
project(Tutorial VERSION 1.0)

# 设置变量CMAKE_CXX_STANDARD为11
# 设置变量CMAKE_CXX_STANDARD_REQUIRED为True
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# 通过使用configure_file将TutorialConfig.h.in中的内容拷贝到TutorialConfig.h中，并将其中需要替换的部分进行替换
# configure_file(TutorialConfig.h.in TutorialConfig.h)

# 创建一个可执行文件，名为Tutorial.exe
# add_executable(Tutorial src/main.cpp)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

# 使用target_include_directories指明程序的头文件所在目录
# target_include_directories(Tutorial PUBLIC "${PROJECT_BINARY_DIR}")
file(GLOB_RECURSE mains RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
foreach(mainfile IN LISTS mains)
    # Get file name without directory
    get_filename_component(mainname ${mainfile} NAME_WE)
    add_executable(${mainname} ${mainfile})
endforeach()
